package cc.cix.hq.common.core.entity.org;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author cix
 */
@Data
@ApiModel(value = "Job对象", description = "定时任务")
@TableName("t_job")
public class Job implements Serializable {

    private static long serialVersionUID = 400066840871805700L;

    /**
     * 任务调度参数 key
     */
    public static String JOB_PARAM_KEY = "JOB_PARAM_KEY";

    /**
     * 定时任务状态：正常
     */
    public static final String STATUS_NORMAL = "0";
    /**
     * 定时任务状态：暂停
     */
    public static final String STATUS_PAUSE = "1";

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("定时任务 ID")
    private Long id;

    @ApiModelProperty("Bean名称")
    private String beanName;

    @TableField(condition = SqlCondition.LIKE)
    @ApiModelProperty("方法名称")
    private String methodName;

    @TableField(condition = SqlCondition.LIKE)
    @ApiModelProperty("方法参数")
    private String params;

    @ApiModelProperty("Cron表达式")
    private String cronExpression;

    @ApiModelProperty("状态")
    private String status;

    @TableField(condition = SqlCondition.LIKE)
    @ApiModelProperty("备注")
    private String remark;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

}
